//
//  LSZPriestPreachedAudioManager.m
//  JKFuYinProject
//
//  Created by 九酷 on 2017/9/20.
//  Copyright © 2017年 LC. All rights reserved.
//

#import "LSZPriestPreachedAudioManager.h"
#import "JKSongsMessStatus.h"
#import "LCPlaylist.h"
#import "NetworkTool+LCAVPlay.h"
@implementation LSZPriestPreachedAudioManager
-(id)initWithDicPriestPreachedAudioManager:(NSDictionary *)dic type:(NSString *)type value:(NSString *)value
{
    self = [super init];
    if (self) {
        self.mutDataArray = [[NSMutableArray alloc]init];
        self.historyArrayData = [[NSMutableArray alloc]init];

        if ([[dic valueForKey:@"data"] isKindOfClass:[NSString class]]) {
            return self;
        }
        if ([[dic valueForKey:@"data"] isKindOfClass:[NSNumber class]]) {
            return self;
        }
        if (![dic valueForKey:@"data"]) {
            return self;
        }
        NSMutableArray * arrayMut = [[NSMutableArray alloc]init];
        NSArray * arrayData = dic[@"data"];
////        value等于1  是热门  机构 讲员 那个地方进来的
        for (NSDictionary * dicton in arrayData) {
            LSZPriestPreachedAudioMg * audioMg = [[LSZPriestPreachedAudioMg alloc]init];
            audioMg.id_id = [NSString stringWithFormat:@"%@",dicton[@"id"]];
            audioMg.image = [NSString stringWithFormat:@"%@",dicton[@"image"]];
            //热门特有的
            if ([dicton valueForKey:@"album"]) {
                audioMg.album = [NSString stringWithFormat:@"%@",dicton[@"album"]];
            }
            if ([dicton valueForKey:@"duration"]) {
                audioMg.duration = [LSZSpecialPackaging TimeStamp:[NSString stringWithFormat:@"%@",dicton[@"duration"]]];
            }
            if ([dicton valueForKey:@"fileUrl"]) {
                audioMg.fileUrl = [NSString stringWithFormat:@"%@",dicton[@"fileUrl"]];
            }
            if ([dicton valueForKey:@"singerName"]) {
                audioMg.singerName = [NSString stringWithFormat:@"%@",dicton[@"singerName"]];
            }
            if ([dicton valueForKey:@"title"]) {
                audioMg.title = [NSString stringWithFormat:@"%@",dicton[@"title"]];
            }
            //多少个专辑
            if ([dicton valueForKey:@"total_album"]) {
                NSString * strTotal_album = [NSString stringWithFormat:@"%@",dicton[@"total_album"]];
                audioMg.total_album = NullStringjudgment(strTotal_album);
            }
            //多少篇文章
            if ([dicton valueForKey:@"total_song"]) {
                NSString * strTotal_song = [NSString stringWithFormat:@"%@",dicton[@"total_song"]];
                audioMg.total_song = NullStringjudgment(strTotal_song);
            } if ([dicton valueForKey:@"total_music"]) {
                NSString * strTotal_music = [NSString stringWithFormat:@"%@",dicton[@"total_music"]];
                audioMg.total_music = NullStringjudgment(strTotal_music);
            }
          
            [arrayMut addObject:audioMg];
        }
        self.mutDataArray  = arrayMut;
        [self.historyArrayData setArray:arrayData];
    }
    return self;
}

@end
@implementation LSZPriestPreachedAudioMg

@end
